﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SCHEDULE_DATA
// * CreateDate    : 2012/8/20 17:48:47
// * Creater       : CodeSmith
// * LastChangeDate: 2012/8/20 17:48:47
// * LastChanger   : 2012/8/20 17:48:47
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class ScheduleDataEntity : EntityBase
    {
        public ScheduleDataTable TableSchema
        {
            get
            {
                return ScheduleDataTable.Current;
            }
        }

        public ScheduleDataEntity()
        {

        }

        public ScheduleDataEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.KeyValue = Convert.ToString(CommonFunctions.ToObject(dr["KEY_VALUE"]));
            this.Subject = Convert.ToString(CommonFunctions.ToObject(dr["SUBJECT"]));
            this.StartTime = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_TIME"]));
            this.IntervalField = Convert.ToDateTime(CommonFunctions.ToObject(dr["INTERVAL_FIELD"]));
            this.Location = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION"]));
            this.ColorValue = Convert.ToInt32(CommonFunctions.ToObject(dr["COLOR_VALUE"]));
            this.StateValue = Convert.ToInt32(CommonFunctions.ToObject(dr["STATE_VALUE"]));
        }

        public ScheduleDataEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.KeyValue = Convert.ToString(CommonFunctions.ToObject(dr["KEY_VALUE"]));
            this.Subject = Convert.ToString(CommonFunctions.ToObject(dr["SUBJECT"]));
            this.StartTime = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_TIME"]));
            this.IntervalField = Convert.ToDateTime(CommonFunctions.ToObject(dr["INTERVAL_FIELD"]));
            this.Location = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION"]));
            this.ColorValue = Convert.ToInt32(CommonFunctions.ToObject(dr["COLOR_VALUE"]));
            this.StateValue = Convert.ToInt32(CommonFunctions.ToObject(dr["STATE_VALUE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ScheduleDataTable.Current;
            }
        }

        #region Perporty List
        public string Id
        {
            get { return Convert.ToString(GetData(ScheduleDataTable.C_ID)); }
            set { SetData(ScheduleDataTable.C_ID, value); }
        }

        public string KeyValue
        {
            get { return Convert.ToString(GetData(ScheduleDataTable.C_KEY_VALUE)); }
            set { SetData(ScheduleDataTable.C_KEY_VALUE, value); }
        }

        public string Subject
        {
            get { return Convert.ToString(GetData(ScheduleDataTable.C_SUBJECT)); }
            set { SetData(ScheduleDataTable.C_SUBJECT, value); }
        }

        public DateTime StartTime
        {
            get { return Convert.ToDateTime(GetData(ScheduleDataTable.C_START_TIME)); }
            set { SetData(ScheduleDataTable.C_START_TIME, value); }
        }

        public DateTime IntervalField
        {
            get { return Convert.ToDateTime(GetData(ScheduleDataTable.C_INTERVAL_FIELD)); }
            set { SetData(ScheduleDataTable.C_INTERVAL_FIELD, value); }
        }

        public string Location
        {
            get { return Convert.ToString(GetData(ScheduleDataTable.C_LOCATION)); }
            set { SetData(ScheduleDataTable.C_LOCATION, value); }
        }

        public int ColorValue
        {
            get { return Convert.ToInt32(GetData(ScheduleDataTable.C_COLOR_VALUE)); }
            set { SetData(ScheduleDataTable.C_COLOR_VALUE, value); }
        }

        public int StateValue
        {
            get { return Convert.ToInt32(GetData(ScheduleDataTable.C_STATE_VALUE)); }
            set { SetData(ScheduleDataTable.C_STATE_VALUE, value); }
        }

        #endregion
    }


}

